<?php

//(PHP 4 >= 4.3.0, PHP 5)

$username = "xxxxx"; //provide your smsroaming username
$password = "xxxxx"; //Provide your smsroaming account password
$chkbal = "0"; //if you want to just check your balance. send 1

$code = "xxx"; //Enter code of destination
$number = "xxxxxxxx"; //Enter number of destination ... without code

$msg = "Solicitud de Ayuda Alerta Tics: "; //your Message
$msg = rawurlencode($msg); //if you will remove this line...you can't send special characters like +$%^^& etc

$sender = "xxxxx"; //In case of international Corporate user of smsroaming..it will not work otherwise



$url = "http://smsroaming.com/my/api/sms-http.php?username=$username&password=$password&code=$code&number=$number&msg=$msg"; //Normal SMS
//$url = "http://smsroaming.com/my/api/sms-http.php?username=$username&password=$password&code=$code&number=$number&msg=$msg&sender=$sender"; //SMS with sender id
//$url = "http://smsroaming.com/my/api/sms-http.php?username=$username&password=$password&chkbal=$chkbal"; //check balance

$output = file_get_contents($url);

if ($output == "1") {
    echo "Message sent!!";
} elseif ($output == "0") {
    echo "Error: Buy Credit!!";
} elseif ($output == "-4") {
    echo "Error: Invalid Code!!";
} elseif ($output == "-5") {
    echo "Error: Invalid Number!!";
} elseif ($output == "-1") {
    echo "Error: Invalid username/password!!";
} elseif ($chkbal == 1) {
    echo $output;
} else {
    echo "Server Down!";
}
?>
